<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://rtc.elef.top/socket.io/socket.io.js"></script>
</head>
<body>
    <button id="startmeeting" onclick="startmeeting()">创建会议</button>
    <script>
        let baseUrl = 'https://rtc.elef.top';

        const socket = io(baseUrl);

        function startmeeting(){
            
            socket.emit('startmeeting', { masterid : '0001',mastername : '王局',pdf : 'https://elef.top/8cf2a17.base64', users:[{userid:'0101',username:'张三'},{userid:'0102',username:'李四'}]  });
        }
        
        function inviteusers(){

            socket.emit('inviteusers', { meetingid : '0001@1597737915614',masterid : '0001',mastername : '王局',pdf : 'https://elef.top/8cf2a17.base64', users:[{userid:'0101',username:'张三'},{userid:'0102',username:'李四'}]  });
        
        }

        socket.on('startmeeting-ok',data => {
            console.log(data);
            url =  `${baseUrl}/chat.html?creater=${data.mastername}&username=${data.mastername}&room=${data.meetingid}&pdf=${data.pdf}`;
            //window.open(url,"互动白板-主办");
            console.log("互动白板-主办");
        });

        socket.on('inviteusers-ok',data => {
            

        });
        


    </script>
</body>
</html>